<template>
  <div class="footer">
    <a-button @click="handleCancel" class="close"> {{ closeText }} </a-button>
    <a-button :loading="loading" type="primary" @click="handleOk">
      {{ okText }}
    </a-button>
  </div>
</template>

<script>
export default {
  props: {
    loading: {
      type: Boolean,
      default: false
    },
    okText: {
      type: String,
      default: '保存'
    },
    closeText: {
      type: String,
      default: '取消'
    }
  },
  data() {
    // 这里存放数据
    return {}
  },
  // 方法集合
  methods: {
    handleCancel() {
      this.$emit('close')
    },
    handleOk() {
      this.$emit('ok')
    }
  }
}
</script>
<style lang="less" scoped>
.footer {
  padding: 20px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  > * {
    margin-right: 20px;
  }
}
</style>
